package com.specificgroup.jira.plugin.acpro.session;

import com.specificgroup.jira.plugin.acpro.Constants;
import com.specificgroup.jira.plugin.acpro.sync.Sync;
import com.specificgroup.jira.plugin.acpro.model.Settings;
import webwork.action.ServletActionContext;

import javax.servlet.http.HttpSession;

/**
 * 
 * @author Ivan Holub
 */
public class SessionUtil {

    public static Settings getSettings() {
        HttpSession session = ServletActionContext.getRequest().getSession();
        Settings settings = (Settings) session.getAttribute(Constants.SETTINGS_SESSION_KEY);
        return settings;
    }

    public static SessionTempData getSessionTempData() {
        HttpSession session = ServletActionContext.getRequest().getSession();
        SessionTempData retValue = (SessionTempData) session.getAttribute(Constants.SESSION_TEMP_DATA_KEY);
        return retValue;
    }

}
